//
// Copyright (C) 2011 - 2013  Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.2 with QuantLib 1.2.1
//#include "stdafx.h"
#include "FixedRateBondHelper.h"
using namespace Cephei::QL::Termstructures::Yield;
#include <gen/QL/Quote.h>
#include <gen/QL/Times/Schedule.h>
#include <gen/QL/Times/DayCounter.h>
#include <gen/QL/Instruments/Bonds/FixedRateBond.h>
#include <gen/QL/Instruments/Bond.h>
#include <gen/QL/Termstructures/YieldTermStructure.h>
#include <gen/QL/Termstructures/Yield/BondHelper.h>
using namespace Cephei::QL;
using namespace Cephei::QL::Times;
using namespace Cephei::QL::Instruments::Bonds;
using namespace Cephei::QL::Instruments;
using namespace Cephei::QL::Termstructures;
#define HANDLE
#undef ABSTRACT
#undef STRUCT
Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::CFixedRateBondHelper (Cephei::QL::IQuote^ cleanPrice, UInt32 settlementDays, Double faceAmount, Cephei::QL::Times::ISchedule^ schedule, Cephei::Core::IVector<Double>^ coupons, Cephei::QL::Times::IDayCounter^ dayCounter, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ paymentConv, Microsoft::FSharp::Core::FSharpOption<Double>^ redemption, Microsoft::FSharp::Core::FSharpOption<DateTime>^ issueDate) : CBondHelper(CFixedRateBondHelper::typeid)
{
    CQuote^ _CcleanPrice;
    CSchedule^ _Cschedule;
    CDayCounter^ _CdayCounter;
    try
    {
#ifdef HANDLE
        _phFixedRateBondHelper = NULL;
#endif
        _CcleanPrice = safe_cast<CQuote^> (cleanPrice);
        _CcleanPrice->Lock();
        Handle<QuantLib::Quote>& _cleanPrice = static_cast<Handle<QuantLib::Quote>&> (_CcleanPrice->GetHandle ()); 
        QuantLib::Natural _settlementDays = (QuantLib::Natural)ValueHelper::Convert (settlementDays); //d
        QuantLib::Real _faceAmount = (QuantLib::Real)ValueHelper::Convert (faceAmount); //d
        _Cschedule = safe_cast<CSchedule^> (schedule);
        _Cschedule->Lock();
        QuantLib::Schedule& _schedule = static_cast<QuantLib::Schedule&> (_Cschedule->GetReference ()); 
        coupons->Lock();
        INativeVector<Double>^ _NCIcoupons = coupons->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCcoupons = safe_cast<CDoubleVector^>(_NCIcoupons);
        std::vector<QuantLib::Rate>& _coupons = static_cast<std::vector<QuantLib::Rate>&> (_NCcoupons->GetReference ());
        _CdayCounter = safe_cast<CDayCounter^> (dayCounter);
        _CdayCounter->Lock();
        QuantLib::DayCounter& _dayCounter = static_cast<QuantLib::DayCounter&> (_CdayCounter->GetReference ()); 
        QuantLib::BusinessDayConvention _paymentConv = 
            (Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>::IsSome::get (paymentConv) ? (QuantLib::BusinessDayConvention)paymentConv->Value : QuantLib::BusinessDayConvention::Following); //10
        QuantLib::Real _redemption = 
            (Microsoft::FSharp::Core::FSharpOption<Double>::IsSome::get (redemption) ? (QuantLib::Real)ValueHelper::Convert (redemption->Value) : 100.0); //4
        QuantLib::Date _issueDate = 
            (Microsoft::FSharp::Core::FSharpOption<DateTime>::IsSome::get (issueDate) ? (QuantLib::Date)ValueHelper::Convert (issueDate->Value) : QuantLib::Date()); //4
        _ppFixedRateBondHelper = new boost::shared_ptr<QuantLib::FixedRateBondHelper> (new QuantLib::FixedRateBondHelper ( _cleanPrice,  _settlementDays,  _faceAmount,  _schedule,  _coupons,  _dayCounter,  _paymentConv,  _redemption,  _issueDate ));
        SetBondHelper (boost::dynamic_pointer_cast<QuantLib::BondHelper> (*_ppFixedRateBondHelper));
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
        if (_CcleanPrice != nullptr) _CcleanPrice->Unlock();
        if (_Cschedule != nullptr) _Cschedule->Unlock();
        if (coupons != nullptr) coupons->Unlock();    //not optional
        if (_CdayCounter != nullptr) _CdayCounter->Unlock();
    }
}
Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::CFixedRateBondHelper (boost::shared_ptr<QuantLib::FixedRateBondHelper>& childNative, Object^ owner) : CBondHelper(CFixedRateBondHelper::typeid)
{
#ifdef HANDLE
	_phFixedRateBondHelper = NULL;
#endif
	_ppFixedRateBondHelper = &childNative;
    _ppBondHelper = new boost::shared_ptr<QuantLib::BondHelper> (boost::dynamic_pointer_cast<QuantLib::BondHelper> (*_ppFixedRateBondHelper));
}
Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::CFixedRateBondHelper (QuantLib::FixedRateBondHelper& childNative, Object^ owner) : CBondHelper(CFixedRateBondHelper::typeid)
{
#ifdef HANDLE
	_phFixedRateBondHelper = NULL;
#endif
	_ppFixedRateBondHelper = new boost::shared_ptr<QuantLib::FixedRateBondHelper> (&childNative);
    _ppBondHelper = new boost::shared_ptr<QuantLib::BondHelper> (boost::dynamic_pointer_cast<QuantLib::BondHelper> (*_ppFixedRateBondHelper));
    _FixedRateBondHelperOwner = owner;
    _BondHelperOwner = owner;
}

Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::CFixedRateBondHelper (CFixedRateBondHelper^ copy) : CBondHelper(CFixedRateBondHelper::typeid)
{
#ifdef HANDLE
	_phFixedRateBondHelper = NULL;
#endif
	if (copy->HasNative() != NULL)
    {
		_ppFixedRateBondHelper = new boost::shared_ptr<QuantLib::FixedRateBondHelper> (copy->GetShared());
        _ppBondHelper = new boost::shared_ptr<QuantLib::BondHelper> (boost::dynamic_pointer_cast<QuantLib::BondHelper> (*_ppFixedRateBondHelper));
    }
}
Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::CFixedRateBondHelper (PLATFORM::Type^ t) : CBondHelper(CFixedRateBondHelper::typeid)
{
#ifdef HANDLE
	_phFixedRateBondHelper = NULL;
#endif
	if (!t->IsSubclassOf(CFixedRateBondHelper::typeid))
		throw REFNEW Exception ("Invalid base-case init");
}
#ifdef HANDLE
Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::CFixedRateBondHelper (QuantLib::Handle<QuantLib::FixedRateBondHelper>& childNative, Object^ owner)  : CBondHelper(CFixedRateBondHelper::typeid)
{
	_phFixedRateBondHelper = &childNative;
	_ppFixedRateBondHelper = &static_cast<boost::shared_ptr<QuantLib::FixedRateBondHelper>>(childNative.currentLink());
    _ppBondHelper = new boost::shared_ptr<QuantLib::BondHelper> (boost::dynamic_pointer_cast<QuantLib::BondHelper> (*_ppFixedRateBondHelper));
    _FixedRateBondHelperOwner = owner;
}
Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::CFixedRateBondHelper (QuantLib::Handle<QuantLib::FixedRateBondHelper> childNative)  : CBondHelper(CFixedRateBondHelper::typeid)
{
	_phFixedRateBondHelper = &childNative;
	_ppFixedRateBondHelper = &static_cast<boost::shared_ptr<QuantLib::FixedRateBondHelper>>(childNative.currentLink());
    _ppBondHelper = new boost::shared_ptr<QuantLib::BondHelper> (boost::dynamic_pointer_cast<QuantLib::BondHelper> (*_ppFixedRateBondHelper));
}
#endif
#ifdef STRUCT
Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::CFixedRateBondHelper (QuantLib::FixedRateBondHelper childNative)  : CBondHelper(CFixedRateBondHelper::typeid)
{
#ifdef HANDLE
	_phFixedRateBondHelper = NULL;
#endif
	_ppFixedRateBondHelper = new boost::shared_ptr<QuantLib::FixedRateBondHelper> (new QuantLib::FixedRateBondHelper (childNative));
    _ppBondHelper = new boost::shared_ptr<QuantLib::BondHelper> (boost::dynamic_pointer_cast<QuantLib::BondHelper> (*_ppFixedRateBondHelper));
}
#endif

Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::~CFixedRateBondHelper ()
{
    if (_ppFixedRateBondHelper != NULL)
    {
	    delete _ppFixedRateBondHelper;
        _ppFixedRateBondHelper = NULL;
    }
}
Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::!CFixedRateBondHelper ()
{
    if (_ppFixedRateBondHelper != NULL)
    {
	    delete _ppFixedRateBondHelper;
    }
}
QuantLib::FixedRateBondHelper& Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::GetReference ()
{
    if (_ppFixedRateBondHelper == NULL) throw REFNEW NativeNullException ();
	return **_ppFixedRateBondHelper;
}
boost::shared_ptr<QuantLib::FixedRateBondHelper>& Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::GetShared ()
{
    if (_ppFixedRateBondHelper == NULL) throw REFNEW NativeNullException ();
	return *_ppFixedRateBondHelper;
}
QuantLib::FixedRateBondHelper* Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::GetPointer ()
{
    if (_ppFixedRateBondHelper == NULL) throw REFNEW NativeNullException ();
	return &**_ppFixedRateBondHelper;
}
#ifdef HANDLE
QuantLib::Handle<QuantLib::FixedRateBondHelper>& Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::GetHandle ()
{
	if (_phFixedRateBondHelper == NULL)
	{
		_phFixedRateBondHelper = new Handle<QuantLib::FixedRateBondHelper> (*_ppFixedRateBondHelper);
	}
	return *_phFixedRateBondHelper;
}
#endif
bool Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::HasNative () 
{
	return (_ppFixedRateBondHelper != NULL);
}

Cephei::QL::Instruments::Bonds::IFixedRateBond^ Cephei::QL::Termstructures::Yield::CFixedRateBondHelper::FixedRateBond::get ()
{
    try
    {
    	boost::shared_ptr<QuantLib::FixedRateBond> _rv = (boost::shared_ptr<QuantLib::FixedRateBond>)(*_ppFixedRateBondHelper)->fixedRateBond ( );   
        Cephei::QL::Instruments::Bonds::CFixedRateBond^ _nrv = REFNEW Cephei::QL::Instruments::Bonds::CFixedRateBond (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::CFixedRateBondHelperVector ()
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
}
Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::~CFixedRateBondHelperVector ()
{
#ifdef STRUCT
	if (_pVValue != NULL) delete _pVValue;
	_pVValue = NULL;
#endif   
	if (_pVBoost != NULL) delete _pVBoost;
	_pVBoost = NULL;
#ifdef HANDLE
	if (_pVHand != NULL) delete _pVHand;
	_pVHand = NULL;
#endif
}
Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::!CFixedRateBondHelperVector ()
{
#ifdef STRUCT
	if (_pVValue != NULL) delete _pVValue;
#endif   
	if (_pVBoost != NULL) delete _pVBoost;
#ifdef HANDLE
	if (_pVHand != NULL) delete _pVHand;
#endif
}
#ifdef STRUCT
Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::CFixedRateBondHelperVector (std::vector<QuantLib::FixedRateBondHelper>& vec, Object^ owner)
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
	_pVValue = &vec;
	_owner = owner;
}
Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::CFixedRateBondHelperVector (std::vector<QuantLib::FixedRateBondHelper> vec)
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
	_pVValue = new std::vector<QuantLib::FixedRateBondHelper> (vec);
}
#endif
Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::CFixedRateBondHelperVector (std::vector<boost::shared_ptr<QuantLib::FixedRateBondHelper>>& vec, Object^ owner)
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
	 _pVBoost = &vec;
	_owner = owner;
}
#ifdef HANDLE
Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::CFixedRateBondHelperVector (std::vector<QuantLib::Handle<QuantLib::FixedRateBondHelper>>& vec, Object^ owner)
{
#ifdef STRUCT
	_pVValue = NULL;
#endif
	_pVBoost = NULL;
#ifdef HANDLE
	_pVHand = NULL;
#endif
	 _pVHand = &vec;
	_owner = owner;
}
#endif

int Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::Count::get ()
{
#ifdef STRUCT
	if (_pVValue != NULL) 
	{
		return _pVValue->size();
	}
#endif    
	if (_pVBoost != NULL)
	{
		return _pVBoost->size ();
	}
#ifdef HANDLE
	if (_pVHand != NULL)
	{
		return _pVHand->size ();
	}
#endif
	return 0;		// should never happen
}
Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^ Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::default::get (int index) 
{
#ifdef STRUCT
	if (_pVValue != NULL) 
	{
    	if ((size_t)index >= _pVValue->size()) throw REFNEW RangeException ();
		QuantLib::FixedRateBondHelper& native = (*_pVValue)[index];
		return REFNEW CFixedRateBondHelper (native, this);
	}
#endif    
	if (_pVBoost != NULL)
	{
    	if ((size_t)index >= _pVBoost->size()) throw REFNEW RangeException ();
		QuantLib::FixedRateBondHelper& native = *(*_pVBoost)[index];
		return REFNEW CFixedRateBondHelper (native, this);
	}
#ifdef HANDLE
	if (_pVHand != NULL)
	{
    	if ((size_t)index >= _pVHand->size()) throw REFNEW RangeException ();
		QuantLib::FixedRateBondHelper& native = *((*_pVHand)[index].currentLink ());
		return REFNEW CFixedRateBondHelper (native, this);
	}
#endif
	return nullptr;		// can never be the case
}
void Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::default::set (int index, Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^ value) 
{
#ifdef STRUCT
	if (_pVValue != NULL)
	{
		if (_pVValue->size() <= (size_t)index)
		{
			// can't happen because vectors are filled from List<> sequentially
			if (_pVValue->size() < (size_t)index)
			{
				throw REFNEW RangeException ();
			}
			_pVValue->push_back (dynamic_cast<CFixedRateBondHelper^>(value)->GetReference ());
		}
        else
        {
            QuantLib::FixedRateBondHelper& c = (*_pVValue)[index];
            c = dynamic_cast<CFixedRateBondHelper^>(value)->GetReference ();
        }
	}
#endif   
	if (_pVBoost != NULL)
	{
		if (_pVBoost->size() <= (size_t)index)
		{
			// can't happen because vectors are filled from List<> sequentially
			if (_pVBoost->size() < (size_t)index)
			{
				throw REFNEW RangeException ();
			}
			_pVBoost->push_back (dynamic_cast<CFixedRateBondHelper^>(value)->GetShared ());
		}
		boost::shared_ptr<QuantLib::FixedRateBondHelper>& c = (*_pVBoost)[index];
		c = dynamic_cast<CFixedRateBondHelper^>(value)->GetShared ();
	}
#ifdef HANDLE
	if (_pVHand != NULL)
	{
		if (_pVHand->size() <= (size_t)index)
		{
			// can't happen because vectors are filled from List<> sequentially
			if (_pVHand->size() < (size_t)index)
			{
				throw REFNEW RangeException ();
			}
			_pVHand->push_back (QuantLib::Handle<QuantLib::FixedRateBondHelper> ());
		}
		QuantLib::Handle<QuantLib::FixedRateBondHelper>& c = (*_pVHand)[index];
		boost::shared_ptr<QuantLib::FixedRateBondHelper>& b = static_cast<boost::shared_ptr<QuantLib::FixedRateBondHelper>>(c.currentLink());
		b = dynamic_cast<CFixedRateBondHelper^>(value)->GetShared ();
	}
#endif
}
Cephei::Core::Generic::ICoCell<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^>^ Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::CItem::get (int index) 
{
	return CellFactory::Instance->Create<IFixedRateBondHelper^> (dynamic_cast<IFixedRateBondHelper^>(default[index]));
}

void Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::CItem::set (int index, Cephei::Core::Generic::ICoCell<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^>^ value) 
{
	default[index] = safe_cast<IFixedRateBondHelper^>(value->Value);
}
#ifdef STRUCT
std::vector<QuantLib::FixedRateBondHelper>& Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::GetReference ()
{
	 return *_pVValue;
}
#endif

std::vector<boost::shared_ptr<QuantLib::FixedRateBondHelper>>& Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::GetShared ()
{
	return *_pVBoost;
}

#ifdef HANDLE
std::vector<QuantLib::Handle<QuantLib::FixedRateBondHelper>>& Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::GetHandle ()
{
	return *_pVHand;
}
#endif
bool Cephei::QL::Termstructures::Yield::CFixedRateBondHelperVector::PrepareFeature (NativeFeature feature)
{
	switch (feature)
	{
#ifdef STRUCT
		case NativeFeature::Value :
			if (_pVValue == NULL)
			{
				_pVValue = new std::vector<QuantLib::FixedRateBondHelper> ();
				return true;
			}
			break;
#endif
        case NativeFeature::shared_ptr :
			if (_pVBoost == NULL)
			{
				_pVBoost = new std::vector<boost::shared_ptr<QuantLib::FixedRateBondHelper>> ();
				return true;
			}
			break;
#ifdef HANDLE
        case NativeFeature::Handle :
            if (_pVHand == NULL)
            {
                _pVHand = new std::vector<QuantLib::Handle<QuantLib::FixedRateBondHelper>> ();
                return true;
            }
            break;
#endif
	}
	return false;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory class

Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^ Cephei::QL::Termstructures::Yield::CFixedRateBondHelper_Factory::Create (Cephei::QL::IQuote^ cleanPrice, UInt32 settlementDays, Double faceAmount, Cephei::QL::Times::ISchedule^ schedule, Cephei::Core::IVector<Double>^ coupons, Cephei::QL::Times::IDayCounter^ dayCounter, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ paymentConv, Microsoft::FSharp::Core::FSharpOption<Double>^ redemption, Microsoft::FSharp::Core::FSharpOption<DateTime>^ issueDate)
{
    return REFNEW CFixedRateBondHelper ( cleanPrice,  settlementDays,  faceAmount,  schedule,  coupons,  dayCounter,  paymentConv,  redemption,  issueDate);
}
/* <summary>Create a single dimension array of FixedRateBondHelper that can be passed into other function </summary> */
IVector<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^>^ Cephei::QL::Termstructures::Yield::CFixedRateBondHelper_Factory::CreateVector ()
 {
	 return REFNEW CoVector<IFixedRateBondHelper^> (REFNEW CFixedRateBondHelperVector ());
 }
IVector<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^>^ Cephei::QL::Termstructures::Yield::CFixedRateBondHelper_Factory::CreateVector (PLATFORM::Collections::Generic::IEnumerable<IFixedRateBondHelper^>^ source)
 {
	 return REFNEW CoVector<IFixedRateBondHelper^> (source, REFNEW CFixedRateBondHelperVector ());
 }
/* <summary>Create a single dimension array of FixedRateBondHelper with change events</summary> */
Cephei::Core::Generic::ICoCell<IVector<Cephei::Core::Generic::ICoCell<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^>^>^>^ Cephei::QL::Termstructures::Yield::CFixedRateBondHelper_Factory::CreateCellVector ()
 {
	 return CellFactory::Instance->Create<IVector<Cephei::Core::Generic::ICoCell<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^>^>^> (REFNEW CoCellVector<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^> (REFNEW CFixedRateBondHelperVector ()));
 }
Cephei::Core::Generic::ICoCell<IVector<Cephei::Core::Generic::ICoCell<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^>^>^>^ Cephei::QL::Termstructures::Yield::CFixedRateBondHelper_Factory::CreateCellVector (PLATFORM::Collections::Generic::IEnumerable<Cephei::Core::Generic::ICoCell<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^>^>^ source)
 {
	 return CellFactory::Instance->Create<IVector<Cephei::Core::Generic::ICoCell<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^>^>^> (REFNEW CoCellVector<Cephei::QL::Termstructures::Yield::IFixedRateBondHelper^> (source, REFNEW CFixedRateBondHelperVector ()));
 }

